//
//  LHQDestinationDetailTableViewCell.m
//  God_is_a_Girl
//
//  Created by dllo on 15/9/25.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LHQDestinationDetailTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation LHQDestinationDetailTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _shr_image = [[UIImageView  alloc] init];
        [self.contentView  addSubview:self.shr_image];
        
        self.visited_count = [[UILabel alloc] init];
        [self.contentView  addSubview:self.visited_count];
        
        self.name = [[UILabel  alloc] init];
        [self.contentView  addSubview:self.name];
        
        self.wish_to_go_count= [[UILabel alloc] init];
        [self.contentView  addSubview:self.wish_to_go_count];
        
    }
    
    return self;
}


-(void)layoutSubviews
{
    
    [super  layoutSubviews];
    
    self.shr_image.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
    
    self.name.frame = CGRectMake(10, self.contentView.frame.size.height/8*5, self.contentView.frame.size.height/1.2, self.contentView.frame.size.height/8);
    
    self.visited_count.frame = CGRectMake(10,self.contentView.frame.size.height / 16 * 13, self.contentView.frame.size.height / 6 * 5, self.contentView.frame.size.height / 12);
    
    self.wish_to_go_count.frame = CGRectMake(self.contentView.frame.size.height / 6 * 2.5 , self.contentView.frame.size.height / 16 * 12.5, 120, 30);
    
}
-(void)setModel:(LHQDestinationDetailModel *)model
{
    NSDictionary  *dic = [model.share_args objectForKey:@"default"];
    NSString  *str = [dic  objectForKey:@"shr_image"];
    
    [self.shr_image  sd_setImageWithURL:[NSURL  URLWithString:str] placeholderImage:[UIImage  imageNamed:@"1436964361872.jpg"]];
    self.name.text = model.name;
    self.name.font = [UIFont  systemFontOfSize:20];
    [self.name  setTextColor:[UIColor  whiteColor]];
    
    self.visited_count.text = [NSString  stringWithFormat:@"%@去过",model.visited_count];
     self.visited_count.font = [UIFont  systemFontOfSize:15];
    [self.visited_count setTextColor:[UIColor  whiteColor]];
    self.wish_to_go_count.text = [NSString  stringWithFormat:@"/ %@喜欢",model.wish_to_go_count];
     self.wish_to_go_count.font = [UIFont  systemFontOfSize:15];
    [self.wish_to_go_count  setTextColor:[UIColor  whiteColor]];
    
  
}


























- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
